# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=rtlamr
pkgver=197.03369d1
pkgrel=4
groups=('blackarch' 'blackarch-radio' 'blackarch-hardware')
pkgdesc='An rtl-sdr receiver for smart meters operating in the 900MHz ISM band.'
arch=('x86_64' 'aarch64')
url='https://github.com/bemasher/rtlamr/'
license=('AGPL')
depends=('fftw')
makedepends=('git' 'go')
source=("git+https://github.com/bemasher/$pkgname.git")
sha512sums=('SKIP')

build() {
  cd $pkgname

  GOPATH="$srcdir" go mod download
  GOPATH="$srcdir" go build \
    -trimpath \
    -buildmode=pie \
    -mod=readonly \
    -modcacherw \
    -ldflags "-s -w" \
    -o $pkgname .
}

package() {
  cd $pkgname

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

